% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dataload_from_pins.R
\name{dataload_from_pins}
\alias{dataload_from_pins}
\title{Utility to download / load datasets from pin board}
\usage{
dataload_from_pins(
  varnames = .arrow_ds_names[1:3],
  boardfolder = "Mark",
  auth = "auto",
  server = "https://rstudio-connect.dmap-stage.aws.epa.gov",
  folder_local_source = NULL,
  envir = globalenv(),
  justchecking = FALSE,
  ignorelocal = FALSE,
  silent = FALSE,
  onAttach = FALSE
)
}
\arguments{
\item{varnames}{character vector of names of R objects to get from board,
or set this to "all" to load all of them}

\item{boardfolder}{if needed to specify a different folder than default}

\item{auth}{See help documentation for \code{\link[pins:board_connect]{pins::board_connect()}}}

\item{server}{if needed to specify a server other than default (which might be
stored in envt variable CONNECT_SERVER or be registered via the rsconnect package).
Note if auth = "envvar" then it looks for CONNECT_SERVER to get name of server which
needs to be the full url starting with https:// - see help for board_connect}

\item{folder_local_source}{path of local folder to
look in for locally saved copies in case pins board is not reachable by user.}

\item{envir}{if needed to specify environment other than default, e.g., globalenv() or parent.frame()}

\item{justchecking}{can set to TRUE to just see a list of what pins are stored in that board}

\item{ignorelocal}{set it to TRUE to avoid 1st checking local disk for copies of files}

\item{silent}{set to TRUE to suppress cat() msgs to console}

\item{onAttach}{Indicates whether the function is being called from onAttach. IF so, it will download all arrow files if user cannot connect to PINS board}
}
\value{
If justchecking = FALSE,

returns vector of names of objects now in memory in specified envir, either because
\enumerate{
\item already in memory or
\item loaded from local disk or
\item successfully downloaded.
}

If justchecking = TRUE, however,

returns vector of names of ALL objects found in specified pin board (or NULL if cannot connect)

regardless of whether they are already in the environment, and

regardless of whether they were specified among varnames, or are related to EJAM at all.
}
\description{
Utility to download / load datasets from pin board
}
\details{
This does work if on VPN and if credentials already set up for the user doing this:

board <- pins::board_connect(auth = "rsconnect")

This does work if that is true plus the two environment variables were created:

\if{html}{\out{<div class="sourceCode">}}\preformatted{board <- pins::board_connect(auth = 'manual',
  server = Sys.getenv("CONNECT_SERVER"),
  key = Sys.getenv("CONNECT_API_KEY")
)
}\if{html}{\out{</div>}}

\if{html}{\out{<div class="sourceCode">}}\preformatted{after Sys.setenv(CONNECT_SERVER = "https://rstudio-connect.dmap-stage.aws.epa.gov")

and   Sys.setenv(CONNECT_API_KEY =  correct-API-key-goes-here  )
}\if{html}{\out{</div>}}
}
